#!/bin/bash

#创建build目录并进入
BUILD="build"
MAKE_SRC=".."

if [ ! -e "${BUILD}" ]; then
    mkdir -p "${BUILD}"
fi

cd "${BUILD}" || {
    echo "进入失败"
    exit 1
}

cmake "${MAKE_SRC}" && make

if [ $? -eq 0 ];then
    echo "成功"
else
    echo "失败"
fi
